//
//  webTableViewCell.m
//  jiaxingchengtou
//
//  Created by michael on 2018/5/28.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "webTableViewCell.h"

@implementation webTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
 if (self) {
 _webview = [[UIWebView alloc]init];
 _webview.delegate = self;
  _webview.scrollView.bounces = NO;
//_webview.scalesPageToFit = YES;
 [self.contentView addSubview:_webview];
 
 }

    return self;

}
- (void)layoutSubviews
{
[super layoutSubviews];
_webview.frame = CGRectMake(0, 0, KScreenWidth, 400);
//_webview.scalesPageToFit = YES;
 NSURL *url = [NSURL URLWithString:_detailModel.html];
     NSData *data = [NSData dataWithContentsOfURL:url];
//
//  [_webview loadRequest:[NSURLRequest requestWithURL:url]];
    [_webview loadData:data MIMEType:@"text/html" textEncodingName:@"GBK" baseURL:url];
    // 2. 把URL告诉给服务器,请求,从m.baidu.com请求数据
//    NSURLRequest *request = [NSURLRequest requestWithURL:url];
//
//    // 3. 发送请求给服务器
//    [self.webview loadRequest:request];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
